package cn.yyljlyy.blog.admin.dao;

import cn.yyljlyy.blog.admin.entity.Permission;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @function: cn.yyljlyy.blog.admin.dao
 * @author: LiJian
 * @data: 2016年11月22日19：03.
 */
@Component
public interface PermissionDao extends JpaRepository<Permission,Integer> {
    @Query("select p from Permission p where p.type= ?1 order by p.pid,p.sorting Asc")
    List<Permission> findAllByTypeOrderByPidSortingAsc(String type);
}
